Missing value imputation algorithm